<template>
	<view>
		<view class="map">
			<map style="width: 750rpx; height: 1200rpx;" :longitude="longitude" :latitude="latitude" scale="16"
				:markers="markers"></map>
		</view>
		<view class="icon">
			<uni-icons type="back" size="30" @click="back"></uni-icons>
		</view>
		<view class="icon1">
		<uni-icons type="more-filled" size="30" ></uni-icons>
		</view>
		<view class="bo">
			<view>
				<view id="addre">中海大厦</view>
				<view id="col">上海市静安区江场三路134号</view>
			</view>
			<view>
				<view class="img1">
					<image src="https://cdn3.axureshop.com/demo/2116044/images/%E5%9C%B0%E5%9D%80%E5%AF%BC%E8%88%AA/u2107.png"></image>
				</view>
				<view class="img2">
					<image src="https://cdn3.axureshop.com/demo/2116044/images/%E5%9C%B0%E5%9D%80%E5%AF%BC%E8%88%AA/u2109.png"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				longitude: 116.39742,
				latitude: 39.909,
				markers: []
			}
		},
		methods: {

		},
		onShow() {
			/* 
			 在h5里面可以用，在微信小程序里面必须要有权限
			 */
			uni.getLocation({
				type: 'wgs84',
				success: (res) => {
					console.log('当前位置的经度：' + res.longitude);
					console.log('当前位置的纬度：' + res.latitude);
					this.longitude = res.longitude;
					this.latitude = res.latitude;
					this.markers = [{
						id: 1,
						latitude: res.latitude,
						longitude: res.longitude,
						// iconPath: '../../static/logo.png'
					}]
				},
				fail(err) {
					console.log(err)
				}
			});
			// uni.authorize({
			// 	scope:'scope.userLocation',
			// 	success:()=>{
			// 		uni.getLocation({
			// 			type: 'wgs84',
			// 			success: function (res) {
			// 				console.log('当前位置的经度：' + res.longitude);
			// 				console.log('当前位置的纬度：' + res.latitude);
			// 			},
			// 			fail(err){
			// 				console.log(err)
			// 			}
			// 		});
			// 	}
			// });
			// uni.chooseLocation({
			// 	success: function (res) {
			// 		console.log('位置名称：' + res.name);
			// 		console.log('详细地址：' + res.address);
			// 		console.log('纬度：' + res.latitude);
			// 		console.log('经度：' + res.longitude);
			// 	}
			// });

		}
	}
</script>

<style>
	.img1 image{
		width: 80rpx;
		height: 80rpx;
		position: absolute;
		
	}
	.img1{
		position: absolute;
		margin-right: 50rpx;
		margin-bottom: 50rpx;
	}
	.img2 image{
		width: 35rpx;
		height: 35rpx;
		transform: rotate(45deg);
		position: absolute;
	}
	.img2{
		/* position: absolute; */
		background-color: #fff;
		width: 35rpx;
		height: 35rpx;
		transform: rotate(135deg);
		margin-bottom: 40rpx;
		margin-top: 25rpx;
		margin-left: 20rpx;
	}
	.map {
		position: absolute;
		width: 50rpx;
		height: 50rpx;
	}
.icon{
	background-color:#aaaaaa;
	position: absolute;
	margin-top: 100rpx;
	margin-left: 50rpx;
	opacity: 0.5;
}
.icon1{
	background-color:#aaaaaa;
	position: absolute;
	margin-top: 100rpx;
	margin-left: 630rpx;
	opacity: 0.5;
}
	.bo {
		display: flex;
		/* justify-content: center; */
		justify-content: space-around;
		align-items: center;
		position: relative;
		width: 750rpx;
		/* height: 200rpx; */
		background-color: #fff;
		top: 1200rpx;
		bottom: 0rpx;
		padding: 10rpx;

	}
	#col{
		color: #c1c1c1;
		padding-bottom: 20rpx;
	}
	#addre{
		padding: 20rpx;
	}
</style>
